#include "KevinToolBoxWdt.h"
#include "./ui_KevinToolBoxWdt.h"

#include <QDebug>
#include <QFile>

KevinToolBoxWdt::KevinToolBoxWdt(QWidget* parent)
    : QWidget(parent)
    , ui(new Ui::KevinToolBoxWdt) {
    ui->setupUi(this);

    // get value
    connect(ui->pushButtonGet, &QPushButton::clicked, [ = ]() mutable {
        ui->labelValue->setText(QString("value = %1").arg(ui->widgetSlide->getValue()));
    });

    // set value
    connect(ui->pushButtonSet, &QPushButton::clicked,
            [ = ]() mutable { ui->widgetSlide->setValue(50); });
}
KevinToolBoxWdt::~KevinToolBoxWdt() {
    delete ui;
}
void KevinToolBoxWdt::study() {
    int count = ui->toolBox->count();
    qDebug() << " KevinLayoutWdt::study() cout = " << count;
    for (size_t i = 0; i < count; i++) {

        // int currentIndex() const;
        // QWidget *widget(int index) const;
        // int indexOf(QWidget *widget) const;
        QWidget* item = ui->toolBox->widget(i);
        qDebug() << i << item->geometry() << item->objectName() << item;
        item->setVisible(true);
    }
}
